String to XMLmode is used, then the text content of the node selected by the location XPath will be converted into an XML structure. If the
XML to Stringmode is used, then the node selected by the XPath will be replaced with it's string representation.
Example
Assume you have called a web service that has returned the following content, which has been inserted into the Datasection of the FactBase.
<ServiceResponse> <ServiceResult><record><value1>abc</value1><value2>123</value2></record></ServiceResult> </ServiceResponse>In this response the
ServiceResultelement actually contains an XML formatted string which we want to access. To do this, add an new XML String action after the Invoke Service action, and use a location XPath of
/mvc:eForm/mvc:Data/ServiceResponse/ServiceResultand a mode of
String to XML. This will convert the content in the FactBase to the following.
... <ServiceResponse> <ServiceResult> <record> <value1>abc</value1> <value2>123</value2> </record> </ServiceResult></quote> </ServiceResponse> ...To convert this back to the initial String content you can set the location XPath to
/mvc:eForm/mvc:Data/ServiceResponse/ServiceResult/recordand use the
XML to Stringmode value.